home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 359_10 / patch4.001 / LIBSRC / PC / GETKEY.S next >
Encoding:
Text File  |  1991-07-21  |  883 b   |  39 lines

  1. /* This is file GETKEY.S */
  2. /*
  3. ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14.  
  15.     .globl    _getkey
  16. _getkey:
  17.     pushl    %ebx
  18.     pushl    %esi
  19.     pushl    %edi
  20.     movb    $0x10,%ah
  21.     int    $0x16
  22.     cmpb    $0xe0,%al
  23.     je    L3
  24.     cmpb    $0,%al
  25.     jne    L1
  26. L3:
  27.     movb    %ah,%al
  28.     movb    $1,%ah
  29.     jmp    L2
  30. L1:
  31.     movb    $0,%ah
  32. L2:
  33.     andl    $0xffff,%eax
  34.     popl    %edi
  35.     popl    %esi
  36.     popl    %ebx
  37.     ret
  38.  
  39.